package com.wc.blue_bridge_history.JavaLast.H_完美队列的数目;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/4/7 19:56
 * @description https://www.lanqiao.cn/paper/3998/problem/3249/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int P = (int) 1e9 + 7;
    static int N = 100010;
    static int[] a = new int[N];
    static int n, k;

    public static void main(String[] args) {
        n = sc.nextInt();
        k = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        Arrays.sort(a, 1, n + 1);
        long res = 0;
        for (int i = 1; i <= n; i++) {
            if (a[i] * 2 > k) break;
            int ll = i, rr = 0;
            int l = i, r = n;
//            while (l < r) {
//                int mid = l + r >> 1;
//                if (a[mid] + a[i] <= k) r = mid;
//                else l = mid + 1;
//            }
//            r = n;
            while (l < r) {
                int mid = l + r + 1 >> 1;
                if (a[mid] + a[i] <= k) l = mid;
                else r = mid - 1;
            }
            rr = r;
            if (rr >= ll) res = (res + qkm(2, rr - ll)) % P;
            // 查找到最左边小于的，再查到最右边小于的
//            int subL = i - ll - 1, subR = i - rr - 1;
//            if (subL == -1) res = (res + 1) % P;
//            else if (subL == subR) res = (res + qkm(2, subL)) % P;
//            else if (subR == -1) res = (res + qkm(2, subL + 1)) % P;
//            else res = ((res + qkm(2, subL + 1) - qkm(2, subR)) % P + P) % P;
        }
        out.println(res);
        out.flush();
    }


    static long qkm(long a, int b) {
        long res = 1;
        while (b > 0) {
            if ((b & 1) == 1) res = res * a % P;
            a = a * a % P;
            b >>= 1;
        }
        return res;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
